#include "../include/client.h"

int clientCd(int sockFd, char *ss){
    //发送要去的目录，接收切换后的结果
    char buf[128] = {0};
    char flag[2] = {0};

    //把命令发送给服务器
    send(sockFd, ss, sizeof(ss), 0);
    //接收服务器的反馈
    recv(sockFd, flag, 1, 0);
    printf("flag = %s\n", flag);
    if(flag[0] == 'u'){
        printf("illegal path!\n");
        return 0;
    }
    else{
        recv(sockFd, buf, sizeof(buf), 0);
        system("clear");
        printf("%s\n", buf);
    }
    return 1;
}

